package com.tudouji.project.harvest.service.impl;

import java.util.List;
import com.tudouji.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tudouji.project.harvest.mapper.WeightSystemDataMapper;
import com.tudouji.project.harvest.domain.WeightSystemData;
import com.tudouji.project.harvest.service.IWeightSystemDataService;

/**
 * 过磅系统数据Service业务层处理
 * 
 * @author tudouji
 * @date 2022-03-28
 */
@Service
public class WeightSystemDataServiceImpl implements IWeightSystemDataService 
{
    @Autowired
    private WeightSystemDataMapper weightSystemDataMapper;

    /**
     * 查询过磅系统数据
     * 
     * @param id 过磅系统数据ID
     * @return 过磅系统数据
     */
    @Override
    public WeightSystemData selectWeightSystemDataById(Long id)
    {
        return weightSystemDataMapper.selectWeightSystemDataById(id);
    }
    @Override
    public WeightSystemData selectWeightSystemDataLast(WeightSystemData id)
    {
        return weightSystemDataMapper.selectWeightSystemDataLast(id);
    }

    /**
     * 查询过磅系统数据列表
     * 
     * @param weightSystemData 过磅系统数据
     * @return 过磅系统数据
     */
    @Override
    public List<WeightSystemData> selectWeightSystemDataList(WeightSystemData weightSystemData)
    {
        return weightSystemDataMapper.selectWeightSystemDataList(weightSystemData);
    }

    /**
     * 新增过磅系统数据
     * 
     * @param weightSystemData 过磅系统数据
     * @return 结果
     */
    @Override
    public int insertWeightSystemData(WeightSystemData weightSystemData)
    {
        weightSystemData.setCreateTime(DateUtils.getNowDate());
        return weightSystemDataMapper.insertWeightSystemData(weightSystemData);
    }

    /**
     * 修改过磅系统数据
     * 
     * @param weightSystemData 过磅系统数据
     * @return 结果
     */
    @Override
    public int updateWeightSystemData(WeightSystemData weightSystemData)
    {
        weightSystemData.setUpdateTime(DateUtils.getNowDate());
        return weightSystemDataMapper.updateWeightSystemData(weightSystemData);
    }

    /**
     * 批量删除过磅系统数据
     * 
     * @param ids 需要删除的过磅系统数据ID
     * @return 结果
     */
    @Override
    public int deleteWeightSystemDataByIds(Long[] ids)
    {
        return weightSystemDataMapper.deleteWeightSystemDataByIds(ids);
    }

    /**
     * 删除过磅系统数据信息
     * 
     * @param id 过磅系统数据ID
     * @return 结果
     */
    @Override
    public int deleteWeightSystemDataById(Long id)
    {
        return weightSystemDataMapper.deleteWeightSystemDataById(id);
    }
}
